<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>tbvcf</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="taninv2.html" title="taninv2" />
    <link rel="next" href="tempest.html" title="tempest" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">tbvcf</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="taninv2.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="tempest.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="tbvcf"></a>
      <div class="titlepage"></div>
      <a id="IndexTbvcf" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">tbvcf</span>
        </h2>
        <p>tbvcf — 
       Models some of the filter characteristics of a Roland TB303 voltage-controlled filter.
          </p>
      </div>
      <div class="refsect1">
        <a id="idp157921904"></a>
        <h2>Description</h2>
        <p>
      This opcode attempts to model some of the filter characteristics of a Roland TB303 voltage-controlled filter. Euler's method is used to approximate the system, rather than traditional filter methods. Cutoff frequency, Q, and distortion are all coupled. Empirical methods were used to try to unentwine,  but frequency is only approximate as a result. Future fixes for some problems with this opcode may break existing orchestras relying on this version of <span class="emphasis"><em>tbvcf</em></span>.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp157924048"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">ares <span class="command"><strong>tbvcf</strong></span> asig, xfco, xres, kdist, kasym [, iskip]</pre>
      </div>
      <div class="refsect1">
        <a id="idp157926320"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>iskip</em></span> (optional, default=0) -- if non zero
    skip the initialisation of the filter. (New in Csound version
    4.23f13 and 5.0)
    </p>
      </div>
      <div class="refsect1">
        <a id="idp157928176"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>asig</em></span> -- input signal. Should be normalized to ±1.
    </p>
        <p>
      <span class="emphasis"><em>xfco</em></span> -- filter cutoff frequency. Optimum range is 10,000 to 1500. Values below 1000 may cause problems.
    </p>
        <p>
      <span class="emphasis"><em>xres</em></span> -- resonance or Q. Typically in the range 0 to 2.
    </p>
        <p>
      <span class="emphasis"><em>kdist</em></span> -- amount of distortion. Typical value is 2. Changing <span class="emphasis"><em>kdist</em></span> significantly from 2 may cause odd interaction with <span class="emphasis"><em>xfco</em></span> and <span class="emphasis"><em>xres</em></span>.
    </p>
        <p>
      <span class="emphasis"><em>kasym</em></span> -- asymmetry of resonance. Typically in the range 0 to 1.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp157935184"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the tbvcf opcode. It uses the file <a class="ulink" href="examples/tbvcf.csd" target="_top"><em class="citetitle">tbvcf.csd</em></a>.

      </p>
        <div class="example">
          <a id="idp157936960"></a>
          <p class="title">
            <strong>Example 920. Example of the tbvcf opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
<span class="comment">; Audio out   Audio in    No messages</span>
-odac           -iadc     -d     <span class="comment">;;;RT audio I/O</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o tbvcf.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="comment">;---------------------------------------------------------</span>
<span class="comment">; TBVCF Test</span>
<span class="comment">; Coded by Hans Mikelson December, 2000</span>
<span class="comment">;---------------------------------------------------------</span>
  <span class="ohdr">sr</span> <span class="op">=</span>  44100   <span class="comment">; Sample rate</span>
  <span class="ohdr">ksmps</span> <span class="op">=</span>  10   <span class="comment">; Samples/Kontrol period</span>
  <span class="ohdr">nchnls</span> <span class="op">=</span>  2        <span class="comment">; Normal stereo</span>
  <span class="ohdr">0dbfs</span> <span class="op">=</span> 1


          <span class="oblock">instr</span> 10

  idur	<span class="op">=</span>	p3			<span class="comment">; Duration</span>
  iamp	<span class="op">=</span>	p4			<span class="comment">; Amplitude</span>
  ifqc	<span class="op">=</span>	<span class="opc">cpspch</span>(p5)		<span class="comment">; Pitch to frequency</span>
  ipanl	<span class="op">=</span>	<span class="opc">sqrt</span>(p6)		<span class="comment">; Pan left</span>
  ipanr	<span class="op">=</span>	<span class="opc">sqrt</span>(1<span class="op">-</span>p6)		<span class="comment">; Pan right</span>
  iq	<span class="op">=</span>	p7
  idist	<span class="op">=</span>	p8
  iasym <span class="op">=</span>	p9

kdclck		<span class="opc">linseg</span>	0, .002, 1, idur<span class="op">-</span>.004, 1, .002, 0	<span class="comment">; Declick envelope</span>
kfco		<span class="opc">expseg</span>	10000, idur, 1000			<span class="comment">; Frequency envelope</span>
ax		<span class="opc">vco</span>		1, ifqc, 2, 0.5			<span class="comment">; Square wave</span>
ay		<span class="opc">tbvcf</span>		ax, kfco, iq, idist, iasym		<span class="comment">; TB-VCF</span>
ay		<span class="opc">buthp</span>	ay<span class="op">/</span>1, 100				<span class="comment">; Hi-pass</span>

		<span class="opc">outs</span>		ay<span class="op">*</span>iamp<span class="op">*</span>ipanl<span class="op">*</span>kdclck, ay<span class="op">*</span>iamp<span class="op">*</span>ipanr<span class="op">*</span>kdclck
          <span class="oblock">endin</span>


<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>

<span class="stamnt">f</span>1 0 65536 10 1

<span class="comment">; TeeBee Test</span>
<span class="comment">;   Sta  Dur  Amp    Pitch Pan  Q    Dist1 Asym</span>
<span class="stamnt">i</span>10 0    0.2  0.5    7.00  .5   0.0  2.0   0.0
<span class="stamnt">i</span>10 0.3  0.2  0.5    7.00  .5   0.8  2.0   0.0
<span class="stamnt">i</span>10 0.6  0.2  0.5    7.00  .5   1.6  2.0   0.0
<span class="stamnt">i</span>10 0.9  0.2  0.5    7.00  .5   2.4  2.0   0.0
<span class="stamnt">i</span>10 1.2  0.2  0.5    7.00  .5   3.2  2.0   0.0
<span class="comment">;i10 1.5  0.2  0.5    7.00  .5   4.0  2.0   0.0</span>
<span class="stamnt">i</span>10 1.8  0.2  0.5    7.00  .5   0.0  2.0   0.25
<span class="stamnt">i</span>10 2.1  0.2  0.5    7.00  .5   0.8  2.0   0.25
<span class="stamnt">i</span>10 2.4  0.2  0.5    7.00  .5   1.6  2.0   0.25
<span class="stamnt">i</span>10 2.7  0.2  0.5    7.00  .5   2.4  2.0   0.25
<span class="stamnt">i</span>10 3.0  0.2  0.5    7.00  .5   3.2  2.0   0.25
<span class="stamnt">i</span>10 3.3  0.2  0.5    7.00  .5   4.0  2.0   0.25
<span class="stamnt">i</span>10 3.6  0.2  0.5    7.00  .5   0.0  2.0   0.5
<span class="stamnt">i</span>10 3.9  0.2  0.5    7.00  .5   0.8  2.0   0.5
<span class="stamnt">i</span>10 4.2  0.2  0.5    7.00  .5   1.6  2.0   0.5
<span class="stamnt">i</span>10 4.5  0.2  0.5    7.00  .5   2.4  2.0   0.5
<span class="stamnt">i</span>10 4.8  0.2  0.5    7.00  .5   3.2  2.0   0.5
<span class="stamnt">i</span>10 5.1  0.2  0.5    7.00  .5   4.0  2.0   0.5
<span class="stamnt">i</span>10 5.4  0.2  0.5    7.00  .5   0.0  2.0   0.75
<span class="stamnt">i</span>10 5.7  0.2  0.5    7.00  .5   0.8  2.0   0.75
<span class="stamnt">i</span>10 6.0  0.2  0.5    7.00  .5   1.6  2.0   0.75
<span class="stamnt">i</span>10 6.3  0.2  0.5    7.00  .5   2.4  2.0   0.75
<span class="stamnt">i</span>10 6.6  0.2  0.5    7.00  .5   3.2  2.0   0.75
<span class="stamnt">i</span>10 6.9  0.2  0.5    7.00  .5   4.0  2.0   0.75
<span class="stamnt">i</span>10 7.2  0.2  0.5    7.00  .5   0.0  2.0   1.0
<span class="stamnt">i</span>10 7.5  0.2  0.5    7.00  .5   0.8  2.0   1.0
<span class="stamnt">i</span>10 7.8  0.2  0.5    7.00  .5   1.6  2.0   1.0
<span class="stamnt">i</span>10 8.1  0.2  0.5    7.00  .5   2.4  2.0   1.0
<span class="stamnt">i</span>10 8.4  0.2  0.5    7.00  .5   3.2  2.0   1.0
<span class="stamnt">i</span>10 8.7  0.2  0.5    7.00  .5   4.0  2.0   1.0
<span class="stamnt">e</span>


<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp157941232"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: Hans Mikelson</td>
          </tr>
          <tr>
            <td>December, 2000 -- January, 2001</td>
          </tr>
        </table>
        <p>
    </p>
        <p>New in Csound 4.10</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="taninv2.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="tempest.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">taninv2 </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> tempest</td>
        </tr>
      </table>
    </div>
  </body>
</html>
